<template>
  <div>
    <h5><span class="badge bg-success">热度查询</span></h5>
    <form>
      <div class="mb-3">
        <label for="exampleInputPassword1" class="form-label">日期</label>
        <input id="date" class="form-control" type="date" v-model="date" />
      </div>
      <div class="align-center">
        <button class="btn btn-success" v-on:click="query()">查询</button>
      </div>
    </form>
  </div>
</template>

<script>
export default {
  data() {
    return {
      date: "",
    };
  },
  methods: {
    query() {
      if (this.date != "") {
        this.$router.push({
          path: "/governmentHotQueryResult",
          query: {
            date: this.date,
          },
        });
      } else {
        alert("信息不完整");
      }
    },
  },
};
</script>

<style scoped>
.align-center {
  text-align: center;
}
header {
  background-color: #2c7d72;
}
</style>